﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HMS.Logging;
using HMS.Common;
using System.Data;
using HMS.BL;
using System.Web.Script.Serialization;
using System.Data.Common;

namespace HMS.PL.Forms
{
    public partial class SQL_SP_Test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            try
            {

                Util.WritInfoLog("$NodeData$", "GetTypes", "Start Creating Connection");
                Connection sqlConn = new Connection();
                Util.WritInfoLog("$NodeData$", "GetTypes", "End Creating Connection");

                //string strQry = "SELECT DISTINCT NODE_TYPE_NAME, IMG_URL,dbo.Get_validChild(TY.NODE_TYPE_ID,TY.HIERARCHY_ID) AS ValidChild";
                //strQry = strQry + " FROM X_HIER_NODE_TYPES TY INNER JOIN X_HIER_NODE_TYPE_PARENT PA ON TY.NODE_TYPE_ID=PA.NODE_TYPE_ID";
                //strQry = strQry + " WHERE TY.HIERARCHY_ID=" + HierarchyId.ToString();

                List<DBParameter> listParams = new List<DBParameter>();
                listParams.Add(new DBParameter("@Hier_Id", DbType.Int32, ParameterDirection.Input, 4, 1));
                listParams.Add(new DBParameter("@NodeType", DbType.String, ParameterDirection.Output, 50));
                DataSet ds = sqlConn.GetDataSetFromFactoryProc("usp_GetHierTypes", ref listParams);
                string val = listParams[1].value.ToString(); 
            }
            catch (Exception ex)
            {
                Util.WritErrorLog("$NodeData$", "GetTypes", "Error in GetTypes", "", ex);
                throw ex;
            }
        }
    }
}